# coding: utf-8

from flask_wtf import FlaskForm
from wtforms import IntegerField, StringField, SubmitField, SelectField, DateField
from wtforms.validators import DataRequired


class BorrorCardAddForm(FlaskForm):
    user_id = StringField('user_id', validators=[DataRequired()])
    card_id = StringField('card_id', validators=[DataRequired()])
    valid_until = DateField('valid_until', validators=[DataRequired()])
    borrow_limit = StringField('borrow_limit', validators=[DataRequired()], default=3,)
    
    submit = SubmitField('借阅证审批通过')


class BorrowCardApplyForm(FlaskForm):
    age = IntegerField('年龄')
    gender = SelectField('性别', choices=[(0, '男'), (1, '女')])
    birthday = DateField('生日', validators=[DataRequired()])
    user_idcard = StringField('身份证', validators=[DataRequired()])
    user_phone = StringField('手机号', validators=[DataRequired()])

    submit = SubmitField('提交申请借阅证')